<template>
  <div class="template-wrap">
    <menu-top></menu-top>
    <div class="content">
      <div class="content-wrap">
        <div>
          <menu-left ref="left" :href="href"></menu-left>
        </div>
        <el-col>
          <div class="order-wrap right-content">
            <el-breadcrumb separator-class="el-icon-arrow-right">
              <el-breadcrumb-item :to="{ path: '/bankBankOrderHand' }">我的订单</el-breadcrumb-item>
              <el-breadcrumb-item>进行中的订单</el-breadcrumb-item>
            </el-breadcrumb>
            <div class="wrap">
              <!-- <div class="title-head">
                待办事项：您好，你本期财务信息尚未提交，<span>点击此处</span>提交财务信息
              </div> -->
              <rotate-message></rotate-message>
              <div class="wrap-container">
                <div class="title">进行中的订单</div>
                <div v-if="list.length && list.length > 0">
                  <div class="order-list" v-for="(item, index) in list" :key="index">
                    <div class="order-item">
                      <div class="state-wrap">
                        <div class="state-list">
                          订单号：{{item.orderId}}
                          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                          当前阶段：<span>{{item.stepName}}</span>
                        </div>
                        <div class="tip">{{item.showTip}}</div>
                        <div class="btn" @click="linkTo('/bankOrderDetail/' + item.orderId)">详情</div>
                      </div>
                      <!-- <div class="info-wrap">
                        <div class="info-title">资金方信息</div>
                        <div class="info-list">
                          <div class="info">贷款产品：<span class="name">{{item.productData.productName}}</span></div>
                          <div class="info">
                            <div class="info-item">
                              投资金额：<span>50万-100万</span>
                            </div>
                            <div class="info-item">
                              总投资金额：<span>50万-100万</span>
                            </div>
                          </div>
                          <div class="info">
                            <div class="info-item">
                              最低回报要求：<span>50万-100万</span>
                            </div>
                            <div class="info-item">
                              投资期限：<span>50万-100万</span>
                            </div>
                          </div>
                          <div class="info">
                            <div class="info-item">
                              资金主体：<span>50万-100万</span>
                            </div>
                            <div class="info-item">
                              投资方式：<span>50万-100万</span>
                            </div>
                          </div>
                          <div class="info">
                            <div class="info-item">
                              投资行业：<span>50万-100万</span>
                            </div>
                            <div class="info-item">
                              投资公司融资阶段：<span>50万-100万</span>
                            </div>
                          </div>
                        </div>
                      </div> -->
                      <div class="info-wrap">
                        <div class="info-title">产品信息</div>
                        <div class="info-list">
                          <div class="info">产品名称：<span class="name">{{item.masterOrder.productData.productName}}</span></div>
                          <div class="info">
                            <div class="info-item">
                              贷款额度：<span>{{item.masterOrder.productData.loanFundMin}}万 ~ {{item.masterOrder.productData.loanFundMax}}万</span>
                            </div>
                            <div class="info-item">
                              贷款适用地区：<span>{{item.masterOrder.productData.financingProvinceName || '--'}}{{item.masterOrder.productData.financingCityName}}</span>
                            </div>
                          </div>
                          <div class="info">
                            <div class="info-item">
                              贷款最高期限：<span>{{item.masterOrder.productData.investYearDesc}}</span>
                            </div>
                            <div class="info-item">
                              申请者最低成立年限：<span>{{item.masterOrder.productData.applyMixYear + '年'}}</span>
                            </div>
                          </div>
                          <div class="info">
                            <div class="info-item">
                              贷款年化利率：<span>{{item.masterOrder.productData.minReportRate + '%/年'}}</span>
                            </div>
                            <div class="info-item">
                              申请者盈利要求：<span>{{item.masterOrder.productData.applyProfit == 'y'?'需盈利':'无要求'}}</span>
                            </div>
                          </div>
                          <div class="info">
                            <div class="info-item">
                              资金主体：<span>{{
                                item.masterOrder.productData.fundBodyDatas.length > 0 
                                ? item.masterOrder.productData.fundBodyDatas.map(item => item.fundBodyDesc).join(',')
                                : '暂无'}}</span>
                            </div>
                            <div class="info-item">
                              申请者最低营业收入要求：<span>{{item.masterOrder.productData.applyMixIncome}}</span>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="data-empty" v-else>
                  暂无数据
                </div>
                <!-- <div class="state-wrap">
                  <div class="state-list">当前阶段:<span>尽调</span></div>
                  <div class="tip">您好，你的资料已经交由XX银行审核，XX银行将会在近期对贵公司进行现场拜访。</div>
                  <div class="btn">详情</div>
                </div>
                <div class="info-wrap">
                  <div class="info-title">资金方信息</div>
                  <div class="info-list">
                    <div class="info">贷款产品：<span class="name">上市无忧</span></div>
                    <div class="info">
                      <div class="info-item">
                        投资金额：<span>50万-100万</span>
                      </div>
                      <div class="info-item">
                        总投资金额：<span>50万-100万</span>
                      </div>
                    </div>
                    <div class="info">
                      <div class="info-item">
                        最低回报要求：<span>50万-100万</span>
                      </div>
                      <div class="info-item">
                        投资期限：<span>50万-100万</span>
                      </div>
                    </div>
                    <div class="info">
                      <div class="info-item">
                        资金主体：<span>50万-100万</span>
                      </div>
                      <div class="info-item">
                        投资方式：<span>50万-100万</span>
                      </div>
                    </div>
                    <div class="info">
                      <div class="info-item">
                        投资行业：<span>50万-100万</span>
                      </div>
                      <div class="info-item">
                        投资公司融资阶段：<span>50万-100万</span>
                      </div>
                    </div>
                  </div>
                </div> -->
              <el-pagination
                class="pagination"
                layout="prev, pager, next"
                :current-page="currentPage"
                :current-change="handleCurrentChange"
                :total="total">
              </el-pagination>
              </div>
            </div>
          </div>
        </el-col>
      </div>
    </div>
  </div>
</template>

<script>
import VueRouter from "vue-router";
import CONSTANT from "../../../constant/constant.js";
import { requestAjax, returnNum } from "../../../common.js";
export default {
  data() {
    return {
      href: "",
      list: [],
      total: 1,
      currentPage: 1
    };
  },
  created() {
    this.loadData(1);
    // this.loadStepList()
  },
  methods: {
    returnNum,
    loadData(index) {
      const url = `${CONSTANT.URL.SYSTEM.DISPATCHUSERORDER}`;
      const params = {
        pageIndex: 1,
        pageSize: 5
      };
      requestAjax(url, "{}", params, ({ status, data }) => {
        if (status == 200) {
          this.list = data.bussData;
        }
      });
    },
    handleCurrentChange(current) {
      this.loadData(current);
    },
    linkTo(path) {
      this.$router.push({path: path, query: {main_path: '/bankBankOrderHand'}});
    }
  },
  components: {
    "menu-top": () => import("../../common/Menu-Top"),
    "menu-left": () => import("../../common/Menu-Left"),
    "rotate-message": () => import("../../common/rotate-message")
  }
};
</script>

<style lang="scss" scoped>
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Avenir", Helvetica, Arial, sans-serif;
}

.content {
  min-height: 100%;
  background-color: #f5f5f5;
  width: 81.3%;
  float: right;
}

.content-wrap {
  overflow: hidden;
}

.order-item {
  background-color: #f2f2f2;
  padding-left: 20px;
  padding-right: 20px;
  margin-bottom: 30px;
}

.data-empty {
  text-align: center;
  line-height: 40px;
  font-size: 16px;
}

.order-wrap {
  padding-top: 29px;
  .wrap {
    background-color: #f5f5f5;
    .title-head {
      height: 50px;
      line-height: 50px;
      background-color: #fff;
      margin-top: 18px;
      padding-left: 20px;
      font-size: 14px;
      color: #666;
      span {
        color: #0087dc;
        cursor: pointer;
      }
    }
    .wrap-container {
      padding: 11px 60px 33px 29px;
      background-color: #fff;
      margin-top: 20px;
      .title {
        height: 56px;
        line-height: 56px;
        font-size: 20px;
      }
      .state-wrap {
        position: relative;
        padding-top: 29px;
        padding-bottom: 39px;
        border-bottom: 1px solid #d1d1d1;
        .state-list {
          font-size: 18px;
          color: #666;
          margin-bottom: 19px;
          span {
            color: #ed7018;
            /*cursor: pointer;*/
          }
        }
        .tip {
          font-size: 14px;
          color: #666;
        }
        .btn {
          position: absolute;
          top: 40px;
          right: 7%;
          width: 100px;
          height: 40px;
          border-radius: 4px;
          -webkit-border-radius: 4px;
          background-color: #ed7018;
          font-size: 18px;
          color: #fff;
          text-align: center;
          line-height: 40px;
          cursor: pointer;
          &:hover {
            background-color: #ed9000;
            transition: all 0.2s linear;
          }
        }
      }
      .info-wrap {
        padding: 22px 0 29px 0;
        // border-bottom: 1px solid #D1D1D1;
        overflow: hidden;
        .info-title {
          width: 55%;
          float: left;
          font-size: 16px;
          color: #333;
          font-weight: bold;
        }
        .info-list {
          width: 55%;
          float: left;
          font-size: 16px;
          color: #666;
          span.name {
            color: #ed7018;
          }
          .info {
            overflow: hidden;
            margin-top: 25px;
            .info-item {
              float: left;
              &:nth-child(2) {
                float: right;
              }
            }
            span {
              color: #111;
              // font-weight: bold;
            }
          }
        }
        .info-detail {
          position: relative;
          top: 23px;
          width: 30.1%;
          float: right;
          margin-right: 7%;
          height: 180px;
          background-color: #e2e2e2;
          padding-top: 30px;
          .detail-list {
            font-size: 16px;
            color: #666;
            padding-left: 10%;
            margin-bottom: 20px;
            span {
              color: #333;
              &.name {
                /*cursor: pointer;*/
                color: #ed7018;
              }
            }
          }
          .btn {
            position: absolute;
            top: 80px;
            right: 7%;
            width: 100px;
            height: 40px;
            border-radius: 4px;
            -webkit-border-radius: 4px;
            background-color: #999999;
            font-size: 18px;
            color: #fff;
            text-align: center;
            line-height: 40px;
            cursor: pointer;
            &:hover {
              background-color: #888;
              transition: all 0.2s linear;
            }
          }
        }
      }
    }
  }
}

a {
  text-decoration: none;
}
</style>